import React, {Component} from 'react';
import RcPagination from 'rc-pagination';
import "rc-pagination/dist/rc-pagination.min.css";

class Pagination extends Component {
	/**
	 * @component RcPagination
	 * @param {Number} pageSize  每页显示数量
	 * @param {Number} total   数据总数
	 * @param {Number} current   当前页码
	 * @method {current,pageSize} onChange方法，当页码发生改变的时候触发，返回两个参数，修改后的页码和pageSize
	 * @param {Boolean} showQuickJumper  是否显示跳页
	 * @param {Boolean} hideOnSinglePage 是否在单页的时候隐藏
	 * */
	render() {
		return (
			<div className="col-md-12">
				<RcPagination
					pageSize={this.props.pageSize}
					current={this.props.pageNum}
					total={this.props.total}
					onChange={current => this.props.onChange(current)}
					showQuickJumper
					hideOnSinglePage
				/>
			</div>
		);
	}
}

export default Pagination;